/**
 * 公共内容引入区
 */
// ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
import React from 'react' // react实例
import ReactDOM from 'react-dom/client' // react元素创建
import { Provider } from 'react-redux' // redux模板标签
import store, { persister } from './store/store' // 封装好的redux的数据来源（若不需要持久化则可以删除persister的引入）
import App from './App' // app组件引入
import { PersistGate } from 'redux-persist/integration/react' // 引入数据持久模板组件（若不需要持久化则可以删除）

// 样式+适配文件引入区
// ---------------------------------------------------------------------------------------------
import './index.css' // index主文件的css
import './common/css/initialization.css' // 公共css

/**
 * 创建全新react实例并与 id为 root 的盒子进行绑定
 */
// ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
  <Provider store={store}>
    {/* （若不需要持久化则可以删除）PersistGate组件，只保留 <App />*/}
    <PersistGate loading={null} persistor={persister}>
      <App />
    </PersistGate>
  </Provider>
)

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
// reportWebVitals();
